package com.zhangtai.modules.service.common;

import com.zhangtai.modules.entity.common.NoticeEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-07-01 20:16:09
 */
@Api(tags = "产品接口")
public interface NoticeService {

    @GetMapping("/findNoticeList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(
                         @RequestParam(value = "type", required = false) Integer type,
                         @RequestParam(value = "msgType", required = false) Integer msgType,
                         @RequestParam(value = "noticeType", required = false) Integer noticeType,
                         @RequestParam(value = "accepterCode", required = false) String accepterCode,
                         @RequestParam(value = "title", required = false) String title,
                         @RequestParam(value = "isRead", required = false) Integer isRead,
                         @RequestParam(value = "isDone", required = false) Integer isDone,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

     List<NoticeEntity> getNoticeByMonth(@RequestParam(value = "accepterId", required = false) String accepterCode,@RequestParam(value = "dateStr", required = false) String dateStr);

    List<NoticeEntity> getNoticeToDoByRelateId(Long relateId,Integer type);
    @GetMapping("/infoNotice")
    @ApiOperation(value = "根据id查找")
        NoticeEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveNotice")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody NoticeEntity entity);

    @PostMapping("/updateNotice")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody NoticeEntity entity);

    @GetMapping("/deleteOneNotice")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteNotices")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

